/*
 * @Author: XieQiu 雪球
 * @Date: 2021-06-03 08:57:52
 * @LastEditTime: 2021-06-03 11:25:31
 * @LastEditors: XieQiu 雪球
 * @Description: 设备类型台账接口
 */
import xjaxiosEquipment from "@/api/axios";
import xjaxios from "@/api/axios";

export default {
  /**
   * @description: 获取设备台账列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  getEquipmentList(params) {
    return xjaxiosEquipment.post("/equipment/queryPageList", {
      page: params.page,
      size: params.size,
      entity: {
        equipmentTypeId: params.equipmentTypeId
      }
    });
  },

  // /**
  //  * @description: 查询所有设备类型
  //  * @param null *
  //  * @return {Object}
  //  */
  queryEquipmentTypeList(params) {
    return xjaxios.post("/commonService/equipmentType/queryByCondition", params);
  },
  queryEquipmentList() {
    return xjaxiosEquipment.get("/equipmentType/list");
  },

  //  查询所有设备
  queryAllEquipment() {
    return xjaxiosEquipment.post("/equipment/queryByCondition", { organizationNo: sessionStorage.organizationNo });
  },
  //  查询设备参数
  queryEquipment(id) {
    return xjaxiosEquipment.get(`/equipment/query/${id}`);
  },
  //  添加
  addAllEquipment(formData) {
    return xjaxiosEquipment.post("/equipment/add", formData);
  },
  //  修改
  editAllEquipment(formData) {
    return xjaxiosEquipment.post("/equipment/edit", formData);
  },
  //  删除
  delAllEquipment(list) {
    return xjaxiosEquipment.post("/equipment/delList", { equipmentIdList: list });
  }
};
